const http=require('http');

const server=http.createServer((request,response)=>{
    
    console.log(request.method);
    console.log(request.url);//只包含路径和字符串
    console.log(request.headers);//可提取头部的信息
    response.end('http');
});

server.listen(8000,()=>{
    console.log('服务启动成功');
});